<!DOCTYPE html>
<html>
    
    <head>
        <title>日志</title>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <!-- Bootstrap -->
        <link href="View/FAST/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="View/FAST/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
        <link href="View/FAST/assets/styles.css" rel="stylesheet" media="screen">
        <link href="View/FAST/assets/DT_bootstrap.css" rel="stylesheet" media="screen">
        <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="View/FAST/vendors/flot/excanvas.min.js"></script><![endif]-->
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->

        <script src="View/FAST/vendors/modernizr-2.6.2-respond-1.1.0.min.js"></script>
    </head>
    
    <body>
	{include h}

        <div class="container-fluid">
            <div class="row-fluid">
				{include l}
                <!--/span-->
                <div class="span10" id="content">
					<button class="btn btn-success btn-large" id="eventButten">事件</button>
					<button class="btn btn-info btn-large" id="serverButten" style="display: none">接收</button>
					<button class="btn btn-warning btn-large" id="clientButten" style="display: none">发送</button>
                    <div class="row-fluid" id="eventFluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">事件日志</div>
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12">
  									<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="eventLogTable">
										<thead>
											<tr>
												<th>id</th>
												<th>时间</th>
												<th>内容</th>
											</tr>
										</thead>
										<tbody>
										</tbody>
									</table>
                                </div>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>
                    <div class="row-fluid hidden" id="serverFluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">接收日志</div>
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12">
                                    <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="serverLogTable">
                                        <thead>
                                        <tr>
                                            <th>id</th>
                                            <th>时间</th>
                                            <th>文件名</th>
                                            <th>速度</th>
                                            <th>大小</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>
                    <div class="row-fluid hidden" id="clientFluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">发送日志</div>
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12">
                                    <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="clientLogTable">
                                        <thead>
                                        <tr>
                                            <th>id</th>
                                            <th>时间</th>
                                            <th>文件名</th>
                                            <th>速度</th>
                                            <th>大小</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>
                </div>
            </div>
            <hr>
			{include f}
        </div>
        <!--/.fluid-container-->

        <script src="View/FAST/vendors/jquery-1.9.1.js"></script>
        <script src="View/FAST/bootstrap/js/bootstrap.min.js"></script>
        <script src="View/FAST/vendors/datatables/js/jquery.dataTables.min.js"></script>


        <script src="View/FAST/assets/scripts.js"></script>
        <script src="View/FAST/assets/DT_bootstrap.js?v=2"></script>
        <script>
            function serverLogTable() {
                $('#serverLogTable').dataTable( {
                    //"deferRender": true,
                    "bProcessing" : true,
                    "bServerSide": true,
                    "sAjaxSource" : '?Log/getServerLog?',
                    "sServerMethod":"POST",
                    "bSort": false,
                    "aoColumns": [
                        { "mData": "lid" },
                        { "mData": "cdt" },
                        { "mData": "fname" },
                        { "mData": "speedB" },
                        { "mData": "fsizeB" },

                    ],
                    "aoColumnDefs": [
//                        { "bSearchable": false, "bVisible": false, "aTargets": [ 2 ] },
//                        { "bVisible": false, "aTargets": [ 3 ] },
                        {
                            "mRender": function ( data, type, row ) {
                                var speed = data/1000000;
                                return  speed.toFixed(2)+"MB/S";
                            },
                            "aTargets": [ 3 ]
                        },
                        {
                            "mRender": function ( data, type, row ) {
                                var speed = data/1000000;
                                return  speed.toFixed(2)+"MB";
                            },
                            "aTargets": [ 4 ]
                        }
                    ],
                    "oLanguage" : {
                        "sProcessing" : "处理中...",
                        "sLengthMenu" : "显示 _MENU_ 项结果",
                        "sZeroRecords" : "没有匹配结果",
                        "sInfo" : "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                        "sInfoEmpty" : "显示第 0 至 0 项结果，共 0 项",
                        "sInfoFiltered" : "(由 _MAX_ 项结果过滤)",
                        "sInfoPostFix" : "",
                        "sSearch" : "搜索:",
                        "sUrl" : "",
                        "sEmptyTable" : "表中数据为空",
                        "sLoadingRecords" : "载入中...",
                        "sInfoThousands" : ",",
                        "oPaginate" : {
                            "sFirst" : "首页",
                            "sPrevious" : "上页",
                            "sNext" : "下页",
                            "sLast" : "末页"
                        },
                        "oAria" : {
                            "sSortAscending" : ": 以升序排列此列",
                            "sSortDescending" : ": 以降序排列此列"
                        }
                    }
                } );
            }
            function clientLogTable() {
                $('#clientLogTable').dataTable( {
                    //"deferRender": true,
                    "bProcessing" : true,
                    "bServerSide": true,
                    "sAjaxSource" : '?Log/getClientLog?',
                    "sServerMethod":"POST",
                    "bSort": false,
                    "aoColumns": [
                        { "mData": "lid" },
                        { "mData": "cdt" },
                        { "mData": "fname" },
                        { "mData": "speedB" },
                        { "mData": "fsizeB" },

                    ],
                    "aoColumnDefs": [
//                        { "bSearchable": false, "bVisible": false, "aTargets": [ 2 ] },
//                        { "bVisible": false, "aTargets": [ 3 ] },
                        {
                            "mRender": function ( data, type, row ) {
                                var speed = data/1000000;
                                return  speed.toFixed(2)+"MB/S";
                            },
                            "aTargets": [ 3 ]
                        },
                        {
                            "mRender": function ( data, type, row ) {
                                var speed = data/1000000;
                                return  speed.toFixed(2)+"MB";
                            },
                            "aTargets": [ 4 ]
                        }
                    ],
                    "oLanguage" : {
                        "sProcessing" : "处理中...",
                        "sLengthMenu" : "显示 _MENU_ 项结果",
                        "sZeroRecords" : "没有匹配结果",
                        "sInfo" : "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                        "sInfoEmpty" : "显示第 0 至 0 项结果，共 0 项",
                        "sInfoFiltered" : "(由 _MAX_ 项结果过滤)",
                        "sInfoPostFix" : "",
                        "sSearch" : "搜索:",
                        "sUrl" : "",
                        "sEmptyTable" : "表中数据为空",
                        "sLoadingRecords" : "载入中...",
                        "sInfoThousands" : ",",
                        "oPaginate" : {
                            "sFirst" : "首页",
                            "sPrevious" : "上页",
                            "sNext" : "下页",
                            "sLast" : "末页"
                        },
                        "oAria" : {
                            "sSortAscending" : ": 以升序排列此列",
                            "sSortDescending" : ": 以降序排列此列"
                        }
                    }
                } );
            }
        $(function() {
			$('#eventLogTable').dataTable( {
				//"deferRender": true,
				"bProcessing" : true,
				"bServerSide": true,
				"sAjaxSource" : '?Log/getEventLog?',
				"sServerMethod":"POST",
                "bSort": false,
                "aoColumns": [
                    { "mData": "eid" },
                    { "mData": "cdt" },
                    { "mData": "content" },

                ],
				"oLanguage" : {
                    "sProcessing" : "处理中...",
                    "sLengthMenu" : "显示 _MENU_ 项结果",
                    "sZeroRecords" : "没有匹配结果",
                    "sInfo" : "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                    "sInfoEmpty" : "显示第 0 至 0 项结果，共 0 项",
                    "sInfoFiltered" : "(由 _MAX_ 项结果过滤)",
                    "sInfoPostFix" : "",
                    "sSearch" : "搜索:",
                    "sUrl" : "",
                    "sEmptyTable" : "表中数据为空",
                    "sLoadingRecords" : "载入中...",
                    "sInfoThousands" : ",",
                    "oPaginate" : {
                        "sFirst" : "首页",
                        "sPrevious" : "上页",
                        "sNext" : "下页",
                        "sLast" : "末页"
                    },
                    "oAria" : {
                        "sSortAscending" : ": 以升序排列此列",
                        "sSortDescending" : ": 以降序排列此列"
                    }
                }
			} );
			setTimeout(serverLogTable(),1500);
            setTimeout(clientLogTable(),3000);
            $("#eventButten").click(function (e) {
                $('#eventFluid').removeClass("hidden");
                $('#serverFluid').addClass("hidden");
                $('#clientFluid').addClass("hidden");
            });
            $("#serverButten").click(function (e) {
                $('#eventFluid').addClass("hidden");
                $('#serverFluid').removeClass("hidden");
                $('#clientFluid').addClass("hidden");


            });
            $("#clientButten").click(function (e) {
                $('#eventFluid').addClass("hidden");
                $('#serverFluid').addClass("hidden");
                $('#clientFluid').removeClass("hidden");

            });

        });
        </script>
    </body>

</html>